# Maintainer: Florian Pritz <bluewind@xinu.at>
# Contributor: Dan McGee <dan@archlinux.org>

pkgname=pacman-mirrorlist
pkgver=20230712
pkgrel=4
pkgdesc="Arch Linux mirror list for use by pacman"
arch=('any')
url="https://www.archlinux.org/mirrorlist/"
license=('GPL')
backup=(etc/pacman.d/mirrorlist)
source=(mirrorlist)

md5sums=('8fcd9c71e50ede93c6e79c8e2ede799f')
sha256sums=('7df6392ad105de15a163a64877c7a9b94cf656e22616f1f7da43fee904482625')

# NOTE on building this package:
# * Go to the trunk/ directory
# * Run bash -c ". PKGBUILD; updatelist"
# * Update the checksums, update pkgver
# * Build the package

updatelist() {
  rm -f mirrorlist
  curl -o mirrorlist https://archapi.zhcn.cc/api/v1/mirrorlist/
}

package() {
  mkdir -p "$pkgdir/etc/pacman.d"
  install -m644 "$srcdir/mirrorlist" "$pkgdir/etc/pacman.d/"
}
